use serde::Serialize;

#[derive(Debug, Serialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct HostDto {
    pub hostname: String,
    pub ip: String,
    pub mac: String,
    pub cpu_arch: String,
    pub kernel_version: String,
    pub os_name: String,
    pub os_version: String,
    pub os_type: String,
    pub distribution: String,
    pub memory: u32,
    pub cpu_count: usize,
    pub cpu_hz: u64,
    pub disk: Vec<u32>,
}


#[derive(Debug, Serialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CpuDto {
    pub name: String,
    pub count: usize,
    pub cpu_hz: u64,
}

#[derive(Debug, Serialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct MemoryDto {
    pub total: u32,
    pub used: u32,
    pub free: u32,
    pub available: u32,
    pub swap_total: u32,
    pub swap_used: u32,
    pub swap_free: u32,
}

#[derive(Debug, Serialize, Default)]
pub struct DiskDto {
    pub label: String,
    pub name: String,
    pub kind: String,
    pub total: u32,
    pub available: u32,
}

#[derive(Debug, Serialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct NetDto {
    pub addr: String,
    pub port: u16,
    pub protocol: String,
    pub pid: u32,
    // pub cmd: String,
    pub v4: bool,
}

#[derive(Debug, Serialize, Default)]
pub struct EnvDto {
    pub name: String,
    pub value: String,
}

#[derive(Debug, Serialize, Default)]
pub struct UserDto {
    pub id: String,
    pub name: String,
    pub groups: String,
}

#[derive(Debug, Serialize, Default)]
pub struct GroupDto {
    pub id: String,
    pub name: String,
}

#[derive(Debug, Serialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ProcessDto {
    pub pid: u32,
    pub ppid: u32,
    pub pwd: String,
    pub cmd: String,
    pub exe: String,
    pub user: String,
    pub uid: String,
    pub usage: f32,
    pub memory: u32,
    pub run_time: u64,
    pub start_time: u64,
}
